import request from '@/utils/request'

export function menuTree() {
  return request({
    url: '/backend/menu/tree',
    method: 'get',
    params: { include: 'roles' }
  })
}

export function createMenu(data) {
  return request({
    url: '/backend/menu/create',
    method: 'post',
    data
  })
}

export function updateMenu(data) {
  return request({
    url: '/backend/menu/update',
    method: 'post',
    data
  })
}

export function deleteMenu(data) {
  return request({
    url: '/backend/menu/delete/' + data.id,
    method: 'get'
  })
}
